const musicToggle = document.getElementById('music-toggle');
const backgroundMusic = document.getElementById('background-music');

// 默认播放
let isPlaying = true;

// 切换音乐状态
musicToggle.addEventListener('click', () => {
  if (isPlaying) {
    backgroundMusic.pause();
    musicToggle.textContent = '🔈'; // 静音图标
  } else {
    backgroundMusic.play();
    musicToggle.textContent = '🔊'; // 播放图标
  }
  isPlaying = !isPlaying;
});
